import request from '@/utils/request'
import apis from '@/api'

export function getOrderList (parameter) {
  return request({
    url: apis.GetOrderList,
    method: 'get',
    params: parameter
  })
}

export function getRefundList (parameter) {
  return request({
    url: apis.RefundList,
    method: 'get',
    params: parameter
  })
}

export function orderConfirm (parameter) {
  return request({
    url: apis.OrderConfirm,
    method: 'get',
    params: parameter
  })
}

export function createOrder (parameter) {
  return request({
    url: apis.CreateOrder,
    method: 'post',
    params: parameter
  })
}

export function createOrderInfo (data, no) {
  return request({
    url: `${apis.CreateOrderInfo}?order_no=${no}`,
    method: 'post',
    data: data
  })
}

export function getOrder (no) {
  return request({
    url: `${apis.GetOrderInfo}?order_no=${no}`,
    method: 'get'
  })
}

export function getPayCallback (no) {
  return request({
    url: `${apis.GetPayCallback}?order_no=${no}`,
    method: 'get'
  })
}
